import os
from google.appengine.ext.webapp import template

def render_to_response(response, path, context):
    '''
    A helper method to render a template

    :param response: The response to write to
    :param path: The template path
    :param context: The data context for the template
    '''
    path = os.path.join(os.path.dirname(__file__), path)
    self.response.out.write(template.render(path, context))
